Skip to content

Added Discretionary Spending System Based on Wealth Trait #6565

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 11, 2025

Conversation

IllianiBird
Copy link
Collaborator

@IllianiBird IllianiBird commented Apr 6, 2025

  • Implemented a discretionary spending system using the "Wealth" trait, with rules inspired by A Time of War: Companion.
  • Added configuration option to enable monthly wealth reinvestment via Campaign Options.
  • Introduced "Extreme Expenditure" action for personnel, affecting wealth, loyalty, and generating reports.
  • Expanded finances logic and resources to include "Wealth" as a new transaction type.
  • Integrated spending calculations and options into the campaign process and GUI.OnWealth.tooltip` property to clarify fund reinvestment by campaign commanders.
  • Removed extraneous whitespace from DiscretionarySpending.properties.

Dev Notes

This implements a system inspired by the Discretionary spending rules in ATOW: Companion. Optionally, each month the campaign commander will reinvest their discretionary fund, adding it to the campaign's coffers. The amount reinvested is based on the character's Wealth trait.

Alternatively, once a month, a character can perform extreme expenditure, which offers a significant payout but permanently reduces the character's Wealth by 1.

The rules for discretionary spending can be found in ATOW: Companion, pages 53-54. The differences between that system and ours are relatively minor:

  • RAW the player should be able to choose if and when they use their discretionary fund. We have the use be automated each month.
  • RAW if a character rolls a natural 2, or beats the check with an MoS of 6+, their Wealth is decreased or increased. I contemplated implementing this, but decided against it as due to the non-optional nature of our implementation it would cause Wealth to plummet very quickly and would cause users to view Wealth as not worth investing in.

Finally, I have to share this image from ATOW: Companion. As this is exactly how I view those players with multi-billion C-Bill campaigns:
image

- Implemented a discretionary spending system using the "Wealth" trait, with rules inspired by A Time of War: Companion.
- Added configuration option to enable monthly wealth reinvestment via Campaign Options.
- Introduced "Extreme Expenditure" action for personnel, affecting wealth, loyalty, and generating reports.
- Expanded finances logic and resources to include "Wealth" as a new transaction type.
- Integrated spending calculations and options into the campaign process and GUI.OnWealth.tooltip` property to clarify fund reinvestment by campaign commanders.
- Removed extraneous whitespace from `DiscretionarySpending.properties`.
```
- Replaced direct `setWealth` call with the new `changeWealth` method in `DiscretionarySpending` class for clarity and better encapsulation.
- Added `changeWealth` method to `Person` class that adjusts the wealth by a specified delta, enhancing code maintainability.
- Documented the new `changeWealth` method with clear Javadoc comments.
@IllianiBird IllianiBird added Personnel Personnel-related Issues Implementation of Missing Official Rule Used with the RFE tag for the implementation of missing official rule labels Apr 6, 2025
@IllianiBird IllianiBird self-assigned this Apr 6, 2025
@IllianiBird IllianiBird removed the Implementation of Missing Official Rule Used with the RFE tag for the implementation of missing official rule label Apr 6, 2025
Copy link

codecov bot commented Apr 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 11.57%. Comparing base (1c9ea2d) to head (99febee).
Report is 64 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6565      +/-   ##
============================================
+ Coverage     11.43%   11.57%   +0.13%     
+ Complexity     6455     6404      -51     
============================================
  Files          1087     1086       -1     
  Lines        139329   139727     +398     
  Branches      21542    21549       +7     
============================================
+ Hits          15935    16176     +241     
- Misses       121802   121978     +176     
+ Partials       1592     1573      -19     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@IllianiBird IllianiBird added the Implementation of Missing Official Rule Used with the RFE tag for the implementation of missing official rule label Apr 10, 2025
@IllianiBird IllianiBird merged commit 29342db into MegaMek:master Apr 11, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Implementation of Missing Official Rule Used with the RFE tag for the implementation of missing official rule Personnel Personnel-related Issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants